package com.aididi.factory;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.concurrent.CountDownLatch;

/**
 * @Auther: zx.xu
 * @Description:   创建消息类
 */
@Component
@Slf4j
public class Receiver {

    private CountDownLatch count = new CountDownLatch(1);

    public void receiverMessage(String message){
        log.info("Received :{}",message);
        count.countDown();
    }

    public CountDownLatch getCount() {
        return count;
    }
}
